home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Applications
/
GW AdaEd 1.4.2
/
GWAdaDemos
/
GWU Demos
/
GWUDEMOS.DOC
< prev
next >
Wrap
Text File
|
1995-04-09
|
3KB
|
98 lines
GW-Ada/Ed Program Development Environment
-----------------------------------------
Demonstration Programs Supplied with GW-Ada/Ed
January 1994
Michael B. Feldman
Department Of Electrical Engineering & Computer Science
School Of Engineering And Applied Science
The George Washington University
202-994-5253
mfeldman@seas.gwu.edu
We have included a number of interesting demonstrations to give the user
of the GW-Ada/Ed system a representative sampling of the capabilities of the
system and of Ada in general. You may use these programs for any valid
educational purpose, as long as you acknowledge their authorship.
First, a few relatively simple programs
just to test the compiler and observe programs in execution. First
compile io_libs.ada, then compile, bind, and execute these in the order
given.
io_libs.ada -- pre-instantiations of Text_IO packages
for predefined types Integer, Float, Boolean
first.ada -- a "hello world" program
fibb.ada -- recursive Fibonacci numbers
parser.ada -- simple recursive-descent expression parser,
converting infix expressions to postfix
Next compile a set of reusable packages that will be used in the rest of
the demos, and which you will find useful for other purposes.
random.ads -- specification for random number package
random.adb -- body
screen.ads -- specification of simple ANSI screen control
screen.adb -- body
windows.ads -- specification of simple window manager
windows.adb -- body
Now you can compile and run these two simple demos.
fourpart.ada -- simple test of screen package
testwind.ada -- simple test of windows package
Finally we have some programs to demonstrate tasking.
Compile these packages,
screenio.ads -- specification of protected screen I/O package,
for use with concurrent programs
screenio.adb -- body
creature.ads -- specification of creatures for simulation of
Unix "worms" game
creature.adb -- body
then compile and run this program:
worms.ada
Now for a simulation of an elevator system. Compile this package
elevator.gen -- generic package for elevators
and then compile and run
elevdemo.ada
Last but not least, we have the notorious Dining Philosophers.
We need to compile three more packages:
chop.ads -- specification for chopsticks
chop.adb -- body
phil.ads -- specification for philosophers
room.ads -- specification for dining room
phil.adb -- body (needs room.ads)
room.adb -- body
Now compile, bind, and run
diners.ada
and you'll see the philosophers eat. Interrupt the program to quit;
otherwise, it will run for a long time.
Finally, we have a version of the philosophers that uses the window
system. Compile an alternative body for the dining room,
roomwind.adb
and just re-bind diners. You should see the diners through the windows.
Enjoy!